﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>意致形（中国）文化傅播有限公司后台管理系统</title>
    <link href="/Content/css/main.css" rel="stylesheet" type="text/css" />
    <link href="/Content/jquery/jquery-easyui-1.3/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />
    <link href="/Content/jquery/jquery-easyui-1.3/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="/Content/jquery/jquery-easyui-1.3/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="/Content/jquery/jquery-easyui-1.3/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="/Content/jquery/jquery-easyui-1.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="/Content/jquery/artDialog/jquery.artDialog.source.js?skin=default" type="text/javascript"></script>
    <script src="/Content/jquery/artDialog/plugins/iframeTools.source.js?skin=default"
        type="text/javascript"></script>
    <script src="/Content/jquery/loading/loading.js" type="text/javascript"></script>
    <script src="/Content/jquery/json2.js" type="text/javascript"></script>
    <script type="text/javascript">
        var _menus = { "menus": [
//						{ "menuid": "1", "icon": "icon-sys", "menuname": "控件使用",
//						    "menus": [
//									{ "menuid": "13", "menuname": "用户管理", "icon": "icon-users", "url": "#" },
//									{ "menuid": "14", "menuname": "角色管理", "icon": "icon-role", "url": "#" },
//									{ "menuid": "15", "menuname": "权限设置", "icon": "icon-set", "url": "#" },
//									{ "menuid": "16", "menuname": "系统日志", "icon": "icon-log", "url": "#" }
//								]
//						},
                         { "menuid": "20", "icon": "icon-sys", "menuname": "内容管理",
                             "menus": [
                                { "menuid": "25", "menuname": "新闻管理列表", "icon": "icon-nav", "url": "/Page/ArticleInfo/List.aspx" },
                                { "menuid": "24", "menuname": "地产案例管理列表", "icon": "icon-nav", "url": "/Page/CaseInfo/List.aspx" },
                                { "menuid": "22", "menuname": "品牌案例管理列表", "icon": "icon-nav", "url": "/Page/BrandInfo/List.aspx" },
                                { "menuid": "23", "menuname": "其它内容管理列表", "icon": "icon-nav", "url": "/Page/TextInfo/List.aspx" },
                                { "menuid": "21", "menuname": "用户管理列表", "icon": "icon-nav", "url": "/Page/UserInfo/List.aspx" }
								]
                         }
//                         { "menuid": "22", "icon": "icon-sys", "menuname": "其它内容管理管理",
//                             "menus": [
//								]
//                         }
				]
        };


        $(function () {
            InitLeftMenu();
            tabClose();
            tabCloseEven();
        })

        //初始化左侧
        function InitLeftMenu() {
            $("#nav").accordion({ animate: false });

            $.each(_menus.menus, function (i, n) {
                var menulist = '';
                menulist += '<ul>';
                $.each(n.menus, function (j, o) {
                    menulist += '<li><div><a ref="' + o.menuid + '" href="#" rel="' + o.url + '" ><span class="icon ' + o.icon + '" >&nbsp;</span><span class="nav">' + o.menuname + '</span></a></div></li> ';
                })
                menulist += '</ul>';

                $('#nav').accordion('add', {
                    title: n.menuname,
                    content: menulist,
                    iconCls: 'icon ' + n.icon
                });

            });

            $('.easyui-accordion li a').click(function () {
                var tabTitle = $(this).children('.nav').text();

                var url = $(this).attr("rel");
                var menuid = $(this).attr("ref");
                var icon = getIcon(menuid, icon);

                addTab(tabTitle, url, icon);

                $('.easyui-accordion li div').removeClass("selected");

                $(this).parent().addClass("selected");

            }).hover(function () {
                $(this).parent().addClass("hover");
            }, function () {
                $(this).parent().removeClass("hover");
            });

            //选中第一个
            var panels = $('#nav').accordion('panels');
            var t = panels[0].panel('options').title;
            $('#nav').accordion('select', t);
        }
        //获取左侧导航的图标
        function getIcon(menuid) {
            var icon = 'icon ';
            $.each(_menus.menus, function (i, n) {
                $.each(n.menus, function (j, o) {
                    if (o.menuid == menuid) {
                        icon += o.icon;
                    }
                })
            })

            return icon;
        }

        function addTab(subtitle, url, icon) {
            if (!$('#tabs').tabs('exists', subtitle)) {
                $('#tabs').tabs('add', {
                    title: subtitle,
                    content: createFrame(url),
                    closable: true,
                    icon: icon
                });
            } else {
                $('#tabs').tabs('select', subtitle);
                $('#mm-tabupdate').click();
            }
            tabClose();
        }

        function createFrame(url) {
            var s = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
            return s;
        }

        function tabClose() {
            /*双击关闭TAB选项卡*/
            $(".tabs-inner").dblclick(function () {
                var subtitle = $(this).children(".tabs-closable").text();
                $('#tabs').tabs('close', subtitle);
            })
            /*为选项卡绑定右键*/
            $(".tabs-inner").bind('contextmenu', function (e) {
                $('#mm').menu('show', {
                    left: e.pageX,
                    top: e.pageY
                });

                var subtitle = $(this).children(".tabs-closable").text();

                $('#mm').data("currtab", subtitle);
                $('#tabs').tabs('select', subtitle);
                return false;
            });
        }
        //绑定右键菜单事件
        function tabCloseEven() {
            //刷新
            $('#mm-tabupdate').click(function () {
                var currTab = $('#tabs').tabs('getSelected');
                var url = $(currTab.panel('options').content).attr('src');
                $('#tabs').tabs('update', {
                    tab: currTab,
                    options: {
                        content: createFrame(url)
                    }
                })
            })
            //关闭当前
            $('#mm-tabclose').click(function () {
                var currtab_title = $('#mm').data("currtab");
                $('#tabs').tabs('close', currtab_title);
            })
            //全部关闭
            $('#mm-tabcloseall').click(function () {
                $('.tabs-inner span').each(function (i, n) {
                    var t = $(n).text();
                    $('#tabs').tabs('close', t);
                });
            });
            //关闭除当前之外的TAB
            $('#mm-tabcloseother').click(function () {
                $('#mm-tabcloseright').click();
                $('#mm-tabcloseleft').click();
            });
            //关闭当前右侧的TAB
            $('#mm-tabcloseright').click(function () {
                var nextall = $('.tabs-selected').nextAll();
                if (nextall.length == 0) {
                    //msgShow('系统提示','后边没有啦~~','error');
                    alert('后边没有啦~~');
                    return false;
                }
                nextall.each(function (i, n) {
                    var t = $('a:eq(0) span', $(n)).text();
                    $('#tabs').tabs('close', t);
                });
                return false;
            });
            //关闭当前左侧的TAB
            $('#mm-tabcloseleft').click(function () {
                var prevall = $('.tabs-selected').prevAll();
                if (prevall.length == 0) {
                    alert('到头了，前边没有啦~~');
                    return false;
                }
                prevall.each(function (i, n) {
                    var t = $('a:eq(0) span', $(n)).text();
                    $('#tabs').tabs('close', t);
                });
                return false;
            });

            //退出
            $("#mm-exit").click(function () {
                $('#mm').menu('hide');
            })
        }

        //弹出信息窗口 title:标题 msgString:提示信息 msgType:信息类型 [error,info,question,warning]
        function msgShow(title, msgString, msgType) {
            $.messager.alert(title, msgString, msgType);
        }

    </script>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
    <noscript>
        <div style="position: absolute; z-index: 100000; height: 2046px; top: 0px; left: 0px;
            width: 100%; background: white; text-align: center;">
            <img src="/Content/images/noscript.gif" alt='抱歉，请开启脚本支持！' />
        </div>
    </noscript>
    <div region="north" split="true" border="false" style="overflow: hidden; height: 70px;
        background: url(/Content/images/layout-browser-hd-bg.gif) #7f99be repeat-x center 50%;
        line-height: 20px; color: #fff; font-family: Verdana, 微软雅黑,黑体">
        <span style="float: right; padding-top:35px; padding-right: 20px;" class="head">欢迎 一线码农 <!--<a href="#"
            id="editpass">修改密码</a>--> <a href="#" id="loginOut">安全退出</a></span> <span style="padding-left: 10px;
                font-size: 16px;">
                <img src="/Content/images/blocks.gif" width="20" height="60" align="absmiddle" />
                意致形（中国）文化傅播有限公司后台管理系统</span>
    </div>
    <div region="south" split="true" style="height: 30px; background: #D2E0F2;">
        <div class="footer">
            By 贺永胜 任力</div>
    </div>
    <!--  导航内容 -->
    <div region="west" hide="true" split="true" title="导航菜单" style="width: 180px;" id="west">
        <div id="nav" class="easyui-accordion" fit="true" border="false">
        </div>
    </div>
    <div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
        <div id="tabs" class="easyui-tabs" fit="true" border="false">
            <div title="欢迎使用" style="padding: 20px; overflow: hidden; color: red;">
            </div>
        </div>
    </div>
</body>
</html>
